package collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 工具类的使用
 */
public class testCollections {
    public static void main(String[] args) {
        List<String> s=new ArrayList<>();
        for (int i=0;i<10;i++){
            s.add("zhang"+i);
        }
        System.out.println(s);
        Collections.shuffle(s);//随机排列
        System.out.println(s);
        Collections.reverse(s);//逆向排序
        System.out.println(s);
        Collections.sort(s);//递增排序
        System.out.println(s);
        System.out.println(Collections.binarySearch(s,"zhang0"));//二分法查找
    }
}
